package com.xiaohong.order.feign;
import com.xiaohong.order.pojo.OrderItem;
import entity.Result;
import entity.StatusCode;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.enums.ParameterIn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="order-service",contextId = "orderItem")
@RequestMapping("/orderItem")
public interface OrderItemFeign {
    /***
     * 多条件搜索OrderItem数据
     * @param orderItem
     * @return
     */
    @PostMapping(value = "/search")
    Result<List<OrderItem>> findList(@RequestBody(required = false) OrderItem orderItem);

    /***
     * 根据ID修改OrderItem数据
     * @param orderItem
     * @param id
     * @return
     */
    @PutMapping(value = "/{id}" )
    Result update(@RequestBody OrderItem orderItem, @PathVariable String id);

    /***
     * 根据ID查询OrderItem数据
     * @param id
     * @return
     */
    @GetMapping("/{id}")
    Result<OrderItem> findById(@PathVariable String id);

}
